<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">

body, #uploadForm, #uploadFile {
    height: 26px;
    margin: 0;
    overflow: hidden;
    padding: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
    cursor: pointer;
    z-index: 1000;
}
</style>
</head>


<body class=" zh_CN">
    <form action="<?=base_url()?>index.php/admin/goods/uploadfile" enctype="multipart/form-data" method="POST" id="uploadForm">
        <input type="file" class="uploadFile" name="uploadFile" id="uploadFile">
		<input type="hidden" val="" class="formId" name="formId">
		<input type="hidden" value="upload3" class="formId" name="backurl">
    </form>

<script src="<?= base_url()?>style/js/base/zepto.min.js"></script>
<script type="text/javascript">
    $("#uploadFile").change( function() {
//        var img = $(this).val();
//        var reg = /\.(jpg|png|gif)$/i;
//        if(!reg.test(img)){
//            alert('文件格式不正确（必须为.jpg/.gif/.png文件）');
//            return false;
//        }
        $('form').submit();
    });
    var x = getNum("addId");
    function getNum(name){
         var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
         var url = decodeURI(window.location.search);
         var r = url.substr(1).match(reg);
         if(r!=null)return  unescape(r[2]); return null;
    }
    var upload_path = "<?php echo (!empty($upload_path)?$upload_path:'') ?>";
    var upload_file = "<?php echo (!empty($upload_file)?$upload_file:'') ?>";
    var upload_name = "<?php echo (!empty($upload_name)?$upload_name:'') ?>";
    var upload_type = "<?php echo (!empty($upload_type)?$upload_type:'') ?>";
    var upload_size = "<?php echo (!empty($upload_size)?$upload_size:'') ?>";
    var upload_url = "<?php echo (!empty($upload_url)?$upload_url:'') ?>";
    if(upload_url != ''){
        window.parent.uploadCallBack3(upload_path,upload_file,upload_name,upload_type,upload_size,upload_url);
        // window.parent.updataImg(upload_url,x);
    }
</script>

</body>

</html>
